﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommandPattern
{
    /// <summary>
    /// 调用者角色
    /// 接收到命令并执行命令，不管什么命令，它都要接收、执行
    /// </summary>
    class Invoker
    {
        /// <summary>
        /// 只读的接收命令
        /// </summary>
        public Command Command
        {
            set;
            private get;
        }

        public void Action()
        {
            this.Command.Execute();
        }
    }
}
